Cube Yogi
Cube Yogi
Leader in Zoho Solutions/Consultation

Create Session entries automatically

Question

You can find this question from this link 👉Missing record from multiple record creation

Answer

You can find the solution to the question from the video below

The Parameters for the Workflow are given below

The Code Snippet is as follows

z = input.Total_Number_of_Sessions;
x = z - 1;
y = input.Interval_between;
iterationString = "".leftPad(x).replaceAll(" ",",").toList().subList(0,x);
startDatevar = input.Start_Date_Time.addDay(y);
for each index i in iterationString
{
	res = insert into Coach_Availability
	[
		Coach_Name=input.Coach_Name
		Start_Date_Time=startDatevar
		End_Date_Time=startDatevar.addHour(1)
		Date_Time=startDatevar
		Added_User=zoho.loginuser
		Slot_Availability="Available"
		Title=input.Title
	];
	startDatevar = startDatevar.addDay(y);
}